{template('../public/header.html')}

<!--友情链接分类-->
<div class="pad_10" >
    <form name="searchform" method="get" >
    <table width="100%" cellspacing="0" class="search_form">
        <tbody>
        <tr>
            <td>
            <div class="explain_col">
                <input type="hidden" name="m" value="admin" />
                <input type="hidden" name="c" value="radio" />
                <input type="hidden" name="a" value="index" />
                <input type="hidden" name="menuid" value="{$menuid}" />
				所属栏目：
                <select class="J_cate_select mr10" data-pid="{$topid}" data-uri="{:U('class/ajax_getchilds?module_id=7&typeid=0')}" data-selected="{$search("selected_ids")}"></select>
                <input type="hidden" name="classid" id="J_cate_id" value="{:search("classid")}" />
                &nbsp;&nbsp;{:L('status')}:
                <select name="status">
                <option value="">-{:L('all')}-</option>
                <option value="1" {if search("status")="1"}selected="selected"{/if}>已审核</option>
                <option value="0" {if search("status")="0"}selected="selected"{/if}>未审核</option>
                </select>
                &nbsp;&nbsp;{:L('keyword')} :
                <input name="keyword" type="text" class="input-text" size="25" value="{$search("keyword")}" />
                <input type="submit" name="search" class="btn" value="{:L('search')}" /><input type="button" name="button" class="btn" value="重设" onclick="location='{:U('radio/index?menuid=' & menuid)}'" />
            </div>
            </td>
        </tr>
        </tbody>
    </table>
    </form>

    <div class="J_tablelist table_list" data-acturi="{:U('radio/ajax_edit')}">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
                <th align="center" width="40"><input type="checkbox" name="checkall" class="J_checkall"></th>
				<th align="center" width="80"><span data-tdtype="order_by" data-field="id">ID</span></th>
                <th align="left"><span data-tdtype="order_by" data-field="name">电台名称</span></th>
                <th align="center" width="60"><span data-tdtype="order_by" data-field="hits">点击数</span></th>
                <th align="center" width="60"><span data-tdtype="order_by" data-field="error">报错数</span></th>
                <th align="center" width="60"><span data-tdtype="order_by" data-field="name">{:L('sort_order')}</span></th>
                <th align="center" width="60"><span data-tdtype="order_by" data-field="status">{:L('enabled')}</span></th>
                <th align="center" width="120">{:L('operations_manage')}</th>
            </tr>
        </thead>
    	<tbody>
            {$rs type='rs' pagesize='0' }
            <tr>
                <td align="center">
                <input type="checkbox" class="J_checkitem" value="{$rs("id")}"></td>
				<td align="center">{$rs("id")}</td>
                <td align="left"><span data-tdtype="edit" data-field="name" data-id="{$rs("id")}" class="tdedit">{$rs("name")}</span></td>
                <td align="center">{$rs("hits")}</td>
                <td align="center">{$rs("error")}</td>
                <td align="center"><span data-tdtype="edit" data-field="ordid" data-id="{$rs("id")}" class="tdedit">{$rs("ordid")}</span></td>
                <td align="center">
                    <img data-tdtype="toggle" data-id="{$rs("id")}" data-field="status" data-value="{$rs("status")}" src="__STATIC__/images/admin/toggle_{if rs('status')=1}enabled{else}disabled{/if}.gif" /></td>
                <td align="center">
                	<a href="javascript:;" class="J_showdialog" data-uri="{:U('radio/edit?id='& rs('id') )}" data-title="{:L('edit')} - {$rs("name")}"  data-id="edit" data-acttype="ajax" data-width="550" data-height="200">{:L('edit')}</a> | 
                    <a href="javascript:;" class="J_confirmurl" data-acttype="ajax" data-uri="{:U('radio/delete?id='& rs('id') )}" data-msg="您确定要删除“<font color=blue>{$rs('name')}</font>”吗？">{:L('delete')}</a> | 
					<a href="javascript:;" class="J_confirmurl" data-acttype="ajax" data-uri="{:U('radio/drop_error?id='& rs('id') )}" data-msg="您确定要消除报错“<font color=blue>{$rs('name')}</font>”吗？" title="消除报错"><font color='#B848FF'>消错</font></a>
                </td>
            </tr>
            {/$rs}
			{@empty for='rs'} <tr style="height:30px;"> <td align="left" colspan="6">&nbsp;&nbsp; <font color=red>暂无数据！</font></td> </tr>{/@empty}
    	</tbody>
    </table>
    </div>

    <div class="btn_wrap_fixed">
    	<label><input type="checkbox" name="checkall" class="J_checkall">{:L('select_all')}/{:L('cancel')}</label>
    	<input type="button" class="btn" data-tdtype="batch_action" data-acttype="ajax" data-uri="{:U('radio/delete')}" data-name="id" data-msg="{:L('confirm_delete')}" value="{:L('delete')}" />
		<div id="pages">
			{@pager data='rs'}
				{$pager("total")} 条记录 {$pager("no")}/{$pager("count")} 页 {if pager("count")>1}{$pager("bar")}{/if}
			{/@pager}
		</div>
    </div>
</div>
{template('../public/footer.html')}
<script>
$('.J_cate_select').cate_select({top_option:lang.all});

$(function(){
	$('.divurl dl input').each(function(i) {
		$(this).attr('name','url'+(i+1));
	});
	$('#num').val( $('.divurl dl input').length );

	$('.icon_del').die('click').live('click',function() {
		$(this).parents('dd').remove();
		if($('.divurl dl input').length<=0) {
			$('.divurl dl').html('<dd><ul><li><input type="text" name="url" class="input-text mt5" value="" style="width:300px;" /></li><li><span class="icon_del" title="删除"></span><span class="icon_add" title="增加"></span></li></ul></dd>');
		}
		$('.divurl dl input').each(function(i) {
			$(this).attr('name','url'+(i+1));
		});
		$('#num').val( $('.divurl dl input').length );
	});

	$('.icon_add').die('click').live('click',function() {
		var html = '<dd><ul><li><input type="text" name="url" class="input-text mt5" value="" style="width:300px;" /></li><li><span class="icon_del" title="删除"></span><span class="icon_add" title="增加" onclick="icon_add()"></span></li></ul></dd>';
		$(this).parents('dd').after(html);
		$('.divurl dl input').each(function(i) {
			$(this).attr('name','url'+(i+1));
		});
		$('#num').val( $('.divurl dl input').length );
	});
});
</script>
<script src="__STATIC__/js/jquery/plugins/jquery.treetable.js"></script>
</body>
</html>
